package com.young.shop.api.dao;

import com.young.shop.pojo.entity.Order;
import com.young.shop.pojo.vo.MyShopCartsVO;
import com.young.shop.pojo.vo.PayVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@ResponseBody
public interface MyCartsMapper {
    /**
     * 插入购物车信息
     * @param goodsId
     * @param userId
     * @param goodsNumber
     * @return
     */
    int insertCart( @Param("goodsId") int goodsId,@Param("userId") int userId, @Param("goodsNumber") int goodsNumber);

    /**
     * 根据id查询购物车
     * @param userId
     * @return
     */
    List<MyShopCartsVO> selectCartsByUserId(@Param("userId") int userId);

    /**
     *
     * @param order
     * @return
     */
    int insertOrder(Order order);

    /**
     *
     * @param goodsId
     * @param goodsNumber
     * @param oid
     * @return
     */
    int insertOrderGoods(@Param("goodsId") int goodsId , @Param("goodsNumber") int goodsNumber, @Param("ordersId") int oid);

    /**
     *
     * @param ordersId
     * @param userId
     * @return
     */
    int insertUserOrders(@Param("ordersId") int ordersId, @Param("userId") int userId);

    /**
     *
     * @param id
     * @return
     */
    int deleteCarts(@Param("id") int id);


    /**
     *
     * @param orderId
     * @return
     */

    List<PayVO> selectPayByOrderId(@Param("id") int orderId);

    int delectCartsById (@Param("id") int id);


}
